/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Rafael
 */
@Embeddable
public class AlunoTurmaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "cd_aluno")
    private int cdAluno;
    @Basic(optional = false)
    @Column(name = "cd_turma")
    private int cdTurma;

    public AlunoTurmaPK() {
    }

    public AlunoTurmaPK(int cdAluno, int cdTurma) {
        this.cdAluno = cdAluno;
        this.cdTurma = cdTurma;
    }

    public int getCdAluno() {
        return cdAluno;
    }

    public void setCdAluno(int cdAluno) {
        this.cdAluno = cdAluno;
    }

    public int getCdTurma() {
        return cdTurma;
    }

    public void setCdTurma(int cdTurma) {
        this.cdTurma = cdTurma;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) cdAluno;
        hash += (int) cdTurma;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AlunoTurmaPK)) {
            return false;
        }
        AlunoTurmaPK other = (AlunoTurmaPK) object;
        if (this.cdAluno != other.cdAluno) {
            return false;
        }
        if (this.cdTurma != other.cdTurma) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.AlunoTurmaPK[cdAluno=" + cdAluno + ", cdTurma=" + cdTurma + "]";
    }

}
